package mx.itesm.timeburrito;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.view.MotionEvent;
import android.view.View;


public class MenuPausa {
	
	private static final int OPCION_CONTINUAR = 0;
	private static final int OPCION_SALIR = 1;

	public static void MostrarMenuPausa(Canvas canvas, Paint p, View v){
		p.setColor(0xAA000000);
		canvas.drawRect(0, 0, v.getWidth(), v.getHeight(), p);
		p.setColor(Color.BLUE);
		p.setTextSize(40);
		p.setAntiAlias(true);
		canvas.drawText("PAUSA", canvas.getWidth()/3, canvas.getHeight()/3, p);
		p.setColor(Color.YELLOW);
		p.setTextSize(30);
		canvas.drawText("Continuar", canvas.getWidth()/2,canvas.getHeight()/2, p);
		canvas.drawText("Salir", canvas.getWidth()/2, canvas.getHeight()/3*2, p);
		//canvas.drawRect(canvas.getWidth()/2, canvas.getHeight()/2,50, 1000,p);
		
	}

	public static int opcionesMenu(MotionEvent event, int canvasHeight, int canvasWidth,Paint p) {
		
		float xEvento=event.getRawX();
		float yEvento=event.getRawY();
		if(xEvento>=canvasWidth/2)
			if(canvasHeight/2-p.getTextSize()<=yEvento && yEvento<=canvasHeight/3*2-p.getTextSize())
				return OPCION_CONTINUAR;
		if(xEvento>=canvasWidth/2)
			if(canvasHeight/3*2<=yEvento)
				return OPCION_SALIR;
		
		return -1;
		
	}

}
